﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestVisioCanvas.Helpers;

using Visio = Microsoft.Office.Interop.Visio;

namespace TestVisioCanvas.Wrappers
{
    /// <summary>
    /// Arguments for the event ShapeTransformed
    /// </summary>    
    public class ShapeTransformedEventArgs : EventArgs
    {
        // Deltas of the Rranslation transformation
        public System.Windows.Point DeltaTranslate { get; set; }
        // Deltas of  the Resize Transformation
        public System.Windows.Point DeltaResize { get; set; }
        public ShapeTransformedEventArgs(System.Windows.Point DeltaTranslate, System.Windows.Point DeltaResize)
        {
            this.DeltaTranslate = DeltaTranslate;
            this.DeltaResize = DeltaResize;
        }
    }
    public delegate void ShapeTransformedEventHandler(object sender, ShapeTransformedEventArgs args);

    /// <summary>
    /// Base interface of all the managed shape. It is the base for the (Almost) Indipendent Shape System (A)ISS
    /// </summary>
    /// <remarks> The IShape interface allows to build a shape managing system that becames almost indipendent
    /// from the drawing control in use. The only reference of a Standard Visio shape is represented
    /// by the VisioShape property.
    /// </remarks>
    public interface IShape
    {
        /// <summary>
        /// Event raised whenever a shape is transformed: resize or translation
        /// </summary>
        event ShapeTransformedEventHandler ShapeTransformed;
        /// <summary>
        /// Property that exposes the ID of the shape
        /// </summary>
        int ID { get; }
        
        /// <summary>
        /// Property that exposes the underlying Visio representation of the shape,
        /// whether it is a standard Visio shape or a CAD drawing
        /// </summary>
        Visio.Shape VisioShape { get; }
    }
    
    public interface ITranslatable
    {
        System.Windows.Point Translate(double OffsetX, double OffsetY);
    }
    
    public interface IResizable
    {
        System.Windows.Point Resize(double NewWidth, double NewHeight);
    }

    /// <summary>
    /// Enumeration of the useful properties of a shape
    /// </summary>
    public enum ShapeProperty
    {
        Angle,
        PinX,
        PinY,
        Width,
        Height
    }

    /// <summary>
    /// Enumeration of the useful properties of a measure
    /// </summary>
    public enum MeasureProperty
    {
        BeginX,
        BeginY,
        EndX,
        EndY,
        Angle
    }
}
